From af6a326c1a6911fb9ef1e56de1912b1b2e1c4e53 Mon Sep 17 00:00:00 2001 From: "kfraser@localhost.localdomain" Date: Thu, 30 Aug 2007 16:41:57 +0100 Subject: [PATCH] qemu: Allow more IDE power management. Made the QEMU IDE disk tolerate more power-mgmt commands, specifically: WIN_SETFEATURE(EN_AAM) - enable automatic acoustic mgmt WIN_SETFEATURE(DIS_AAM) - disable automatic acoustic mgmt WIN_SETFEATURE(DIS_APM) - disable automatic power mgmt WIN_STANDBY WIN_SETIDLE1 WIN_SLEEPNOW1 WIN_STANDBY2 WIN_SETIDLE2 WIN_SLEEPNOW2 WIN_STANDBYNOW2 These are all essentially no-ops, like existing support for EN_RLA (enable read lookahead) and WIN_STANDBYNOW1. This fixes a crash in the SLES9-SP3 64bit kernel when the powersaved was started (with ACPI or ACM). This guest really only needs EN_AAM, DIS_APM, and WIN_SETIDLE1 support, but the others seemed sensible to include. I've excluded EN_APM since I'm unsure of what that's agreeing to do. It's probably ok to include. Signed-off-by: Ben Guthro Signed-off-by: David Lively --- tools/ioemu/hw/ide.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tools/ioemu/hw/ide.c b/tools/ioemu/hw/ide.c index 3b138c76e4..f5e796171f 100644 --- a/tools/ioemu/hw/ide.c +++ b/tools/ioemu/hw/ide.c @@ -1876,6 +1876,9 @@ static void ide_ioport_write(void *opaque, uint32_t addr, uint32_t val) break; case 0xaa: /* read look-ahead enable */ case 0x55: /* read look-ahead disable */ + case 0x42: /* EN_AAM: enable Automatic Acoustic Mode */ + case 0xc2: /* DIS_AAM: disable Automatic Acoustic Mode */ + case 0x85: /* DIS_APM: disable APM */ s->status = READY_STAT | SEEK_STAT; ide_set_irq(s); break; @@ -1914,8 +1917,15 @@ static void ide_ioport_write(void *opaque, uint32_t addr, uint32_t val) s->status = READY_STAT; ide_set_irq(s); break; - case WIN_STANDBYNOW1: case WIN_IDLEIMMEDIATE: + case WIN_STANDBY: + case WIN_SETIDLE1: + case WIN_STANDBYNOW1: + case WIN_SLEEPNOW1: + case WIN_STANDBY2: + case WIN_SETIDLE2: + case WIN_STANDBYNOW2: + case WIN_SLEEPNOW2: s->status = READY_STAT; ide_set_irq(s); break; -- 2.30.2